// Copyright (c) 2006 Zorm
// Released under the MIT License

#ifndef ALBERSTOLATLON_H
#define ALBERSTOLATLON_H

const double R = 6371007;
const double M_PI = 3.1415926535897932384626433832795;

inline double deg2rad(double deg) {
	return deg * (M_PI / 180.0);
}

inline double rad2deg(double rad) {
	return rad * (180.0 / M_PI);
}

inline void GetCart(double theta, double angle, double *x, double *y) {
	*x = cos(angle);
	*x *= theta;
	*y = sin(angle);
	*y *= theta;
}

class AlbersToLatLon {

public:
	AlbersToLatLon(double SP1, double SP2, double lat, double lon);
	void Convert(double x, double y, double *newx, double *newy);

private:
	double P0, C, n, lon;
};

#endif